<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * type.php
 * @author ranuandra
 *
 * 24 Agu 2011 23:57:20
 *
 * 
 */

include_once Kohana::find_file('vendor', 'Excel/excel.php',  array(), array());
$excel = new Excel_Export();

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");;
header("Content-Disposition: attachment;filename=$courseid-$sec.xls "); 
header("Content-Transfer-Encoding: binary ");
$excel->xlsBOF(); 
$excel->xlsWriteLabel(1,0,"DATA PENJUALAN MOBIL");
$excel->xlsWriteLabel(2,0,"NAMA");
$excel->xlsWriteLabel(2,1,"ALAMAT");
$excel->xlsWriteLabel(2,2,"JUMLAH");
$excel->$xlsRow = 3;
foreach($datas as $data) 
{
  ++$i;
  xlsWriteNumber($xlsRow,0,$data['nama']);
  xlsWriteNumber($xlsRow,1,$data['alamat']);
  xlsWriteLabel($xlsRow,2,$data['jumlah']);
  $xlsRow++;
}
xlsEOF();
exit();

?>